package main

import (
	// "gokit_study/endpoints"
	"gokit_study/hi/handlers"
	"gokit_study/hi/svc"
	proto "gokit_study/protos"
	uhandlers "gokit_study/user/handlers"
	usvc "gokit_study/user/svc"
	"net"

	// "gokit_study/services"
	// "gokit_study/transports"
	// "net/http"

	// kithttp "github.com/go-kit/kit/transport/http"
	"google.golang.org/grpc"
)

func main() {
	// userService := services.UserService{}
	// userEndpoint := endpoints.GenerateUserEndpoint(userService)
	// kitServer := kithttp.NewServer(userEndpoint, transports.DecodeUserRequest, transports.EncodeUserResponse)
	// err := http.ListenAndServe(":8998", kitServer)
	// if err != nil {
	// 	panic(err)
	// }

	gs := grpc.NewServer()
	proto.RegisterUserServer(gs, usvc.MakeGRPCServer(usvc.NewEndpoints(uhandlers.NewService())))
	proto.RegisterHiServer(gs, svc.MakeGRPCServer(svc.NewEndpoints(handlers.NewService())))
	ls, _ := net.Listen("tcp", ":9888")
	gs.Serve(ls)
}
